package com.jiangruan.javaproject.Bigjob;

import com.jiangruan.javaproject.bean.Constellations;
import com.jiangruan.javaproject.bean.HotVideo;
import com.jiangruan.javaproject.bean.MobliesQuery;
import com.jiangruan.javaproject.service.*;

import java.util.List;
import java.util.Scanner;

/**
 * @author:xulonghua
 * @email:3162193565@qq.com
 * @desc:该功能用于封装聚合函数的api
 * @datetime 2021/12/26 23:15
 */
public class AggreGation {
    public void aggregation(){
       while (true){
           Scanner scanner = new Scanner ( System.in );
           System.out.println ("输入你想要的功能");
           System.out.println ("1.查看热门视频数据");
           System.out.println ("2.星座查询");
           System.out.println ("3.手机号查询");
           System.out.println ("4.防疫政策指南");
           System.out.println ("5.城市查询");
           System.out.println ("0.退出");
           int i = scanner.nextInt ();
           if (i==0){
               break;
           }
           switch (i){
               case 1:
                   HotVideoService hotVideoService = new HotVideoService ();
                   for (HotVideo hotVideo : hotVideoService.getHotVideo ()) {
                       System.out.println (hotVideo.getShare_url ());
                   }
                   break;
               case 2:
                   Constellation constellation = new Constellation ();
                   Constellations constellation1 = constellation.constellation ();
                   System.out.println ("name :"+constellation1.getName ());
                   System.out.println ("datetime :"+constellation1.getDatetime ());
                   System.out.println ("date :"+constellation1.getDate ());
                   System.out.println ("all :"+constellation1.getAll ());
                   System.out.println ("color :"+constellation1.getColor ());
                   System.out.println ("Health :"+constellation1.getHealth ());
                   System.out.println ("love :"+constellation1.getLove ());
                   System.out.println ("Money: "+constellation1.getMoney ());
                   System.out.println ("Number ："+constellation1.getNumber ());
                   System.out.println ("QFriend ："+constellation1.getQFriend ());
                   System.out.println ("Summary ："+constellation1.getSummary ());
                   System.out.println ("Work ："+constellation1.getWork ());
                   System.out.println ("error ："+constellation1.getError_code ());
                   break;
               case 3:
                   MoblieQuery moblieQuery = new MoblieQuery ();
                   List<MobliesQuery> result = moblieQuery.moblie ().getResult ();
                   System.out.println ("province"+result.get ( 0 ).getProvince ());
                   System.out.println ("city"+result.get ( 0 ).getCity ());
                   System.out.println ("areacode"+result.get ( 0 ).getAreacode ());
                   System.out.println ("zip"+result.get ( 0 ).getZip ());
                   System.out.println ("company"+result.get ( 0 ).getCompany ());
                   System.out.println ("card"+result.get ( 0 ).getCard ());
                   break;
               case 4:
                   EpidemiCprevention epidemiCprevention = new EpidemiCprevention ();
                   System.out.println ("province_id :"+epidemiCprevention.epidemicprevention ().getResult ().get ( 0 ).getProvince_id ());
                   System.out.println ("province :"+epidemiCprevention.epidemicprevention ().getResult ().get ( 0 ).getProvince ());
                   System.out.println ("city_id :"+epidemiCprevention.epidemicprevention ().getResult ().get ( 0 ).getCitys ().get ( 0 ).getCity_id ());
                   System.out.println ("city :"+epidemiCprevention.epidemicprevention ().getResult ().get ( 0 ).getCitys ().get ( 0 ).getCity () );
                   break;
               case 5:
                   Weather weather = new Weather ();
                   System.out.println ( weather.weather ());
                   break;
                   default:
                       System.out.println ("输入真确的序号，超出范围");
           }
       }
    }
}
